<?php

/**
 * Application Models
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 * @copyright ZF model generator
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */

/**
 * Abstract class for models
 */
require_once 'ModelAbstract.php';

/**
 * 
 *
 * @package Application_Model
 * @subpackage Model
 * @author <YOUR NAME HERE>
 */
class Application_Model_PilotRequestcomp extends Application_Model_ModelAbstract
{

    /**
     * Database var type varchar(255)
     *
     * @var string
     */
    protected $_IdPILOTREQUESTCOMP;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_WHEREZONE;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_FROMZONE;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_SELECTZONE;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_GROUPBYZONE;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_JOINTUREZONE;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_HAVAINGZONE;

    /**
     * Database var type text
     *
     * @var text
     */
    protected $_ORDERBYZONE;

    /**
     * Database var type int(11)
     *
     * @var int
     */
    protected $_PILOTREQUESTIdPILOTREQUEST;


    /**
     * Parent relation fk_PILOT_REQUESTCOMP_PILOT_REQUEST10
     *
     * @var Application_Model_PilotRequest
     */
    protected $_PilotRequest;


    /**
     * Sets up column and relationship lists
     */
    public function __construct()
    {
        parent::init();
        $this->setColumnsList(array(
            'idPILOT_REQUESTCOMP'=>'IdPILOTREQUESTCOMP',
            'WHEREZONE'=>'WHEREZONE',
            'FROMZONE'=>'FROMZONE',
            'SELECTZONE'=>'SELECTZONE',
            'GROUPBYZONE'=>'GROUPBYZONE',
            'JOINTUREZONE'=>'JOINTUREZONE',
            'HAVAINGZONE'=>'HAVAINGZONE',
            'ORDERBYZONE'=>'ORDERBYZONE',
            'PILOT_REQUEST_idPILOT_REQUEST'=>'PILOTREQUESTIdPILOTREQUEST',
        ));

        $this->setParentList(array(
            'FkPILOTREQUESTCOMPPILOTREQUEST10'=> array(
                    'property' => 'PilotRequest',
                    'table_name' => 'PilotRequest',
                ),
        ));

        $this->setDependentList(array(
        ));
    }

    /**
     * Sets column idPILOT_REQUESTCOMP
     *
     * @param string $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setIdPILOTREQUESTCOMP($data)
    {
        $this->_IdPILOTREQUESTCOMP = $data;
        return $this;
    }

    /**
     * Gets column idPILOT_REQUESTCOMP
     *
     * @return string
     */
    public function getIdPILOTREQUESTCOMP()
    {
        return $this->_IdPILOTREQUESTCOMP;
    }

    /**
     * Sets column WHEREZONE
     *
     * @param text $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setWHEREZONE($data)
    {
        $this->_WHEREZONE = $data;
        return $this;
    }

    /**
     * Gets column WHEREZONE
     *
     * @return text
     */
    public function getWHEREZONE()
    {
        return $this->_WHEREZONE;
    }

    /**
     * Sets column FROMZONE
     *
     * @param text $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setFROMZONE($data)
    {
        $this->_FROMZONE = $data;
        return $this;
    }

    /**
     * Gets column FROMZONE
     *
     * @return text
     */
    public function getFROMZONE()
    {
        return $this->_FROMZONE;
    }

    /**
     * Sets column SELECTZONE
     *
     * @param text $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setSELECTZONE($data)
    {
        $this->_SELECTZONE = $data;
        return $this;
    }

    /**
     * Gets column SELECTZONE
     *
     * @return text
     */
    public function getSELECTZONE()
    {
        return $this->_SELECTZONE;
    }

    /**
     * Sets column GROUPBYZONE
     *
     * @param text $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setGROUPBYZONE($data)
    {
        $this->_GROUPBYZONE = $data;
        return $this;
    }

    /**
     * Gets column GROUPBYZONE
     *
     * @return text
     */
    public function getGROUPBYZONE()
    {
        return $this->_GROUPBYZONE;
    }

    /**
     * Sets column JOINTUREZONE
     *
     * @param text $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setJOINTUREZONE($data)
    {
        $this->_JOINTUREZONE = $data;
        return $this;
    }

    /**
     * Gets column JOINTUREZONE
     *
     * @return text
     */
    public function getJOINTUREZONE()
    {
        return $this->_JOINTUREZONE;
    }

    /**
     * Sets column HAVAINGZONE
     *
     * @param text $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setHAVAINGZONE($data)
    {
        $this->_HAVAINGZONE = $data;
        return $this;
    }

    /**
     * Gets column HAVAINGZONE
     *
     * @return text
     */
    public function getHAVAINGZONE()
    {
        return $this->_HAVAINGZONE;
    }

    /**
     * Sets column ORDERBYZONE
     *
     * @param text $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setORDERBYZONE($data)
    {
        $this->_ORDERBYZONE = $data;
        return $this;
    }

    /**
     * Gets column ORDERBYZONE
     *
     * @return text
     */
    public function getORDERBYZONE()
    {
        return $this->_ORDERBYZONE;
    }

    /**
     * Sets column PILOT_REQUEST_idPILOT_REQUEST
     *
     * @param int $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setPILOTREQUESTIdPILOTREQUEST($data)
    {
        $this->_PILOTREQUESTIdPILOTREQUEST = $data;
        return $this;
    }

    /**
     * Gets column PILOT_REQUEST_idPILOT_REQUEST
     *
     * @return int
     */
    public function getPILOTREQUESTIdPILOTREQUEST()
    {
        return $this->_PILOTREQUESTIdPILOTREQUEST;
    }

    /**
     * Sets parent relation PILOTREQUESTIdPILOTREQUEST
     *
     * @param Application_Model_PilotRequest $data
     * @return Application_Model_PilotRequestcomp
     */
    public function setPilotRequest(Application_Model_PilotRequest $data)
    {
        $this->_PilotRequest = $data;

        $primary_key = $data->getPrimaryKey();
        if (is_array($primary_key)) {
            $primary_key = $primary_key['idPILOT_REQUEST'];
        }

        $this->setPILOTREQUESTIdPILOTREQUEST($primary_key);

        return $this;
    }

    /**
     * Gets parent PILOTREQUESTIdPILOTREQUEST
     *
     * @param boolean $load Load the object if it is not already
     * @return Application_Model_PilotRequest
     */
    public function getPilotRequest($load = true)
    {
        if ($this->_PilotRequest === null && $load) {
            $this->getMapper()->loadRelated('FkPILOTREQUESTCOMPPILOTREQUEST10', $this);
        }

        return $this->_PilotRequest;
    }

    /**
     * Returns the mapper class for this model
     *
     * @return Application_Model_Mapper_PilotRequestcomp
     */
    public function getMapper()
    {
        if ($this->_mapper === null) {
            $this->setMapper(new Application_Model_Mapper_PilotRequestcomp());
        }

        return $this->_mapper;
    }

    /**
     * Deletes current row by deleting the row that matches the primary key
     *
	 * @see Application_Model_Mapper_PilotRequestcomp::delete
     * @return int|boolean Number of rows deleted or boolean if doing soft delete
     */
    public function deleteRowByPrimaryKey()
    {
        if ($this->getIdPILOTREQUESTCOMP() === null) {
            throw new Exception('Primary Key does not contain a value');
        }

        return $this->getMapper()
                    ->getDbTable()
                    ->delete('idPILOT_REQUESTCOMP = ' .
                             $this->getMapper()
                                  ->getDbTable()
                                  ->getAdapter()
                                  ->quote($this->getIdPILOTREQUESTCOMP()));
    }
}
